﻿<!--
Copyright (c) Microsoft Corporation.  All rights reserved.
-->

<ResourceDictionary
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
        xmlns:System="clr-namespace:System;assembly=mscorlib">

        <!-- This file contains trivial templates that are used by other controls -->


        <ControlTemplate x:Key="PhoneScrollbarThumb" TargetType="Thumb">
                <Rectangle IsHitTestVisible="False" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Fill="{TemplateBinding Background}" />
        </ControlTemplate>


        <ControlTemplate x:Key="PhoneSimpleRepeatButton" TargetType="RepeatButton">
                <Rectangle Fill="Transparent" />
        </ControlTemplate>


        <ControlTemplate x:Key="PhoneSimpleThumb" TargetType="Thumb">
                <Rectangle Fill="Transparent" />
        </ControlTemplate>

        <ControlTemplate x:Key="PhoneDisabledTextBoxTemplate" TargetType="TextBox">
                <ContentControl x:Name="ContentElement" BorderThickness="0" Padding="{TemplateBinding Padding}" Margin="{StaticResource PhoneTextBoxInnerMargin}"
    HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" />
        </ControlTemplate>


        <!-- x:Key="PhoneDisabledPasswordBox" -->
        <ControlTemplate x:Key="PhoneDisabledPasswordBoxTemplate" TargetType="PasswordBox">
                <Border x:Name="ContentElement" BorderThickness="0" Padding="{TemplateBinding Padding}" Margin="{StaticResource PhonePasswordBoxInnerMargin}"/>
        </ControlTemplate>





        <!--x:Key="PhoneContentControl"-->
        <Style TargetType="ContentControl">
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="ContentControl">
                                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>

        <!--x:Key="PhoneScrollViewer"-->
        <Style TargetType="ScrollViewer">
                <Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
                <Setter Property="HorizontalScrollBarVisibility" Value="Disabled"/>
                <Setter Property="Background" Value="Transparent"/>
                <Setter Property="Padding" Value="0"/>
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="BorderBrush" Value="Transparent"/>
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="ScrollViewer">
                                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                                                <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup x:Name="ScrollStates">
                                                                <VisualStateGroup.Transitions>
                                                                        <VisualTransition GeneratedDuration="00:00:00.5"/>
                                                                </VisualStateGroup.Transitions>
                                                                <VisualState x:Name="Scrolling">
                                                                        <Storyboard>
                                                                                <DoubleAnimation Storyboard.TargetName="VerticalScrollBar" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
                                                                                <DoubleAnimation Storyboard.TargetName="HorizontalScrollBar" Storyboard.TargetProperty="Opacity" To="1" Duration="0"/>
                                                                        </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="NotScrolling">
                                                                </VisualState>
                                                        </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Grid Margin="{TemplateBinding Padding}">
                                                        <ScrollContentPresenter x:Name="ScrollContentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                                        <ScrollBar x:Name="VerticalScrollBar" IsHitTestVisible="False" Opacity="0" Height="Auto" Width="5" HorizontalAlignment="Right" VerticalAlignment="Stretch" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" IsTabStop="False" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Value="{TemplateBinding VerticalOffset}" Orientation="Vertical" ViewportSize="{TemplateBinding ViewportHeight}" />
                                                        <ScrollBar x:Name="HorizontalScrollBar" IsHitTestVisible="False" Opacity="0" Width="Auto" Height="5" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" IsTabStop="False" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Value="{TemplateBinding HorizontalOffset}" Orientation="Horizontal" ViewportSize="{TemplateBinding ViewportWidth}" />
                                                </Grid>
                                        </Border>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>

        <!--x:Key="PhoneButtonBase"-->
        <Style x:Key="PhoneButtonBase" TargetType="ButtonBase">
                <Setter Property="Background" Value="Transparent"/>
                <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
                <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
                <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
                <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMedium}"/>
                <Setter Property="Padding" Value="10,5,10,6"/>

                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="ButtonBase">
                                        <Grid Background="Transparent">
                                                <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup x:Name="CommonStates">
                                                                <VisualState x:Name="Normal"/>
                                                                <VisualState x:Name="MouseOver"/>
                                                                <VisualState x:Name="Pressed">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentContainer" Storyboard.TargetProperty="Foreground">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneButtonBasePressedForegroundBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="Background">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneAccentBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="Disabled">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentContainer" Storyboard.TargetProperty="Foreground">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="BorderBrush">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="Background">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                        </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0" Background="{TemplateBinding Background}" Margin="{StaticResource PhoneTouchTargetOverhang}" >
                                                        <ContentControl x:Name="ContentContainer" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Padding="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                                </Border>
                                        </Grid>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>

        <!--x:Key="PhoneButtonBase"-->
        <Style TargetType="ButtonBase" BasedOn="{StaticResource PhoneButtonBase}"/>

        <!--x:Key="PhoneButton"-->
        <Style TargetType="Button" BasedOn="{StaticResource PhoneButtonBase}"/>

        <!--x:Key="PhoneRepeatButton"-->
        <Style TargetType="RepeatButton" BasedOn="{StaticResource PhoneButtonBase}"/>

        <!--x:Key="PhoneToggleButton"-->
        <Style TargetType="ToggleButton" BasedOn="{StaticResource PhoneButtonBase}">
                <Setter Property="Padding" Value="8"/>
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="ToggleButton">
                                        <Grid Background="Transparent" >
                                                <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup x:Name="CommonStates">
                                                                <VisualState x:Name="Normal"/>
                                                                <VisualState x:Name="Disabled">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EnabledBackground" Storyboard.TargetProperty="Visibility">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                                                                <DiscreteObjectKeyFrame.Value>
                                                                                                        <Visibility>Collapsed</Visibility>
                                                                                                </DiscreteObjectKeyFrame.Value>
                                                                                        </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledBackground" Storyboard.TargetProperty="Visibility">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                                                                <DiscreteObjectKeyFrame.Value>
                                                                                                        <Visibility>Visible</Visibility>
                                                                                                </DiscreteObjectKeyFrame.Value>
                                                                                        </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                        </VisualStateGroup>
                                                        <VisualStateGroup x:Name="CheckStates">
                                                                <VisualState x:Name="Unchecked" />
                                                                <VisualState x:Name="Checked">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EnabledBackground" Storyboard.TargetProperty="Background">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneAccentBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EnabledContent" Storyboard.TargetProperty="Foreground">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneButtonBasePressedForegroundBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledBackground" Storyboard.TargetProperty="Background">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledBackground" Storyboard.TargetProperty="BorderBrush">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledContent" Storyboard.TargetProperty="Foreground">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                        </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Border x:Name="EnabledBackground" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="{StaticResource PhoneTouchTargetOverhang}">
                                                        <ContentControl x:Name="EnabledContent" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                                </Border>
                                                <Border x:Name="DisabledBackground" IsHitTestVisible="False" Background="Transparent" BorderBrush="{StaticResource PhoneDisabledBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="{StaticResource PhoneTouchTargetOverhang}" Visibility="Collapsed">
                                                        <ContentControl x:Name="DisabledContent" Foreground="{StaticResource PhoneDisabledBrush}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                                </Border>
                                        </Grid>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>

        <!--x:Key="PhoneRadioButtonCheckBoxBase"-->
        <Style x:Key="PhoneRadioButtonCheckBoxBase" TargetType="ToggleButton" BasedOn="{StaticResource PhoneButtonBase}">
                <Setter Property="Background" Value="{StaticResource PhoneRadioCheckBoxBrush}"/>
                <Setter Property="BorderBrush" Value="{StaticResource PhoneRadioCheckBoxBorderBrush}"/>
                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMedium}"/>
                <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
                <Setter Property="HorizontalContentAlignment" Value="Left"/>
                <Setter Property="VerticalContentAlignment" Value="Center"/>
                <Setter Property="Padding" Value="0"/>
        </Style>

        <!--x:Key="PhoneCheckBox"-->
        <Style TargetType="CheckBox" BasedOn="{StaticResource PhoneRadioButtonCheckBoxBase}">
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="CheckBox">
                                        <Grid Background="Transparent" HorizontalAlignment="Left">
                                                <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup x:Name="CommonStates">
                                                                <VisualState x:Name="Normal"/>
                                                                <VisualState x:Name="MouseOver"/>
                                                                <VisualState x:Name="Pressed" >
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckBackground" Storyboard.TargetProperty="Background">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneRadioCheckBoxPressedBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckMark" Storyboard.TargetProperty="Fill">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneButtonBasePressedForegroundBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IndeterminateMark" Storyboard.TargetProperty="Fill">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneButtonBasePressedForegroundBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="Disabled">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckBackground" Storyboard.TargetProperty="BorderBrush">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckMark" Storyboard.TargetProperty="Fill">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IndeterminateMark" Storyboard.TargetProperty="Fill">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentContainer" Storyboard.TargetProperty="Foreground">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                        </VisualStateGroup>
                                                        <VisualStateGroup x:Name="CheckStates">
                                                                <VisualState x:Name="Checked">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckMark" Storyboard.TargetProperty="Visibility">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                                                                <DiscreteObjectKeyFrame.Value>
                                                                                                        <Visibility>Visible</Visibility>
                                                                                                </DiscreteObjectKeyFrame.Value>
                                                                                        </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="Unchecked" />
                                                                <VisualState x:Name="Indeterminate">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IndeterminateMark" Storyboard.TargetProperty="Visibility">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                                                                <DiscreteObjectKeyFrame.Value>
                                                                                                        <Visibility>Visible</Visibility>
                                                                                                </DiscreteObjectKeyFrame.Value>
                                                                                        </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                        </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Grid Margin="{StaticResource PhoneTouchTargetLargeOverhang}">
                                                        <Grid.ColumnDefinitions>
                                                                <ColumnDefinition Width="32"/>
                                                                <ColumnDefinition Width="*"/>
                                                        </Grid.ColumnDefinitions>
                                                        <Grid Grid.Column="0" VerticalAlignment="Top">
                                                                <Border x:Name="CheckBackground" IsHitTestVisible="False" VerticalAlignment="Center" HorizontalAlignment="Left" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{StaticResource PhoneBorderThickness}" Height="32" Width="32"/>
                                                                <Rectangle x:Name="IndeterminateMark" IsHitTestVisible="False" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{StaticResource PhoneRadioCheckBoxCheckBrush}" Visibility="Collapsed"/>
                                                                <Path x:Name="CheckMark" IsHitTestVisible="False" Visibility="Collapsed" Width="23" Height="21" Stretch="Fill" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{StaticResource PhoneRadioCheckBoxCheckBrush}" 
                  Data="M0,123 L39,93 L124,164 L256,18 L295,49 L124,240 z" StrokeLineJoin="Round" StrokeThickness="3" FlowDirection="LeftToRight"/>
                                                        </Grid>
                                                        <ContentControl x:Name="ContentContainer" Grid.Column="1" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="12,0,0,0" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Padding="{TemplateBinding Padding}" Foreground="{TemplateBinding Foreground}" />
                                                </Grid>
                                        </Grid>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>

        <!--x:Key="PhoneRadioButton"-->
        <Style TargetType="RadioButton" BasedOn="{StaticResource PhoneRadioButtonCheckBoxBase}">
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="RadioButton">
                                        <Grid Background="Transparent" >
                                                <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup x:Name="CommonStates">
                                                                <VisualState x:Name="Normal"/>
                                                                <VisualState x:Name="MouseOver"/>
                                                                <VisualState x:Name="Pressed" >
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckBackground" Storyboard.TargetProperty="Fill">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneRadioCheckBoxPressedBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckMark" Storyboard.TargetProperty="Fill">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneButtonBasePressedForegroundBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="Disabled">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckBackground" Storyboard.TargetProperty="Stroke">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckMark" Storyboard.TargetProperty="Fill">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentContainer" Storyboard.TargetProperty="Foreground">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                        </VisualStateGroup>
                                                        <VisualStateGroup x:Name="CheckStates">
                                                                <VisualState x:Name="Checked">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckMark" Storyboard.TargetProperty="Visibility">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                                                                <DiscreteObjectKeyFrame.Value>
                                                                                                        <Visibility>Visible</Visibility>
                                                                                                </DiscreteObjectKeyFrame.Value>
                                                                                        </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="Unchecked" />
                                                                <VisualState x:Name="Indeterminate"/>
                                                        </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Grid Margin="{StaticResource PhoneTouchTargetLargeOverhang}">
                                                        <Grid.ColumnDefinitions>
                                                                <ColumnDefinition Width="32"/>
                                                                <ColumnDefinition Width="*"/>
                                                        </Grid.ColumnDefinitions>
                                                        <Ellipse x:Name="CheckBackground" IsHitTestVisible="False" VerticalAlignment="Center" HorizontalAlignment="Left" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{StaticResource PhoneStrokeThickness}" Height="32" Width="32"/>
                                                        <Ellipse x:Name="CheckMark" IsHitTestVisible="False" Visibility="Collapsed" Fill="{StaticResource PhoneRadioCheckBoxCheckBrush}" Height="16" Width="16" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                                        <ContentControl x:Name="ContentContainer" Grid.Column="1" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" Margin="12,0,0,0" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Padding="{TemplateBinding Padding}" Foreground="{TemplateBinding Foreground}" />
                                                </Grid>
                                        </Grid>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>

        <!--x:Key="PhoneListBoxItem"-->
        <Style TargetType="ListBoxItem">
                <Setter Property="Background" Value="Transparent"/>
                <Setter Property="BorderThickness" Value="0" />
                <Setter Property="BorderBrush" Value="Transparent" />
                <Setter Property="Padding" Value="0" />
                <Setter Property="HorizontalContentAlignment" Value="Left"/>
                <Setter Property="VerticalContentAlignment" Value="Top"/>
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="ListBoxItem">
                                        <Border x:Name="LayoutRoot" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                                                <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup x:Name="CommonStates">
                                                                <VisualState x:Name="Normal"/>
                                                                <VisualState x:Name="MouseOver" />
                                                                <VisualState x:Name="Disabled">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Background">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}"/>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <DoubleAnimation Storyboard.TargetName="ContentContainer" Storyboard.TargetProperty="Opacity" Duration="0" To=".5" />
                                                                        </Storyboard>
                                                                </VisualState>
                                                        </VisualStateGroup>
                                                        <VisualStateGroup x:Name="SelectionStates">
                                                                <VisualState x:Name="Unselected"/>
                                                                <VisualState x:Name="Selected">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentContainer" Storyboard.TargetProperty="Foreground">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneAccentBrush}"/>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                        </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <ContentControl x:Name="ContentContainer" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
            Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Foreground="{TemplateBinding Foreground}" />
                                        </Border>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>

        <!--x:Key="PhoneListBox"-->
        <Style TargetType="ListBox">
                <Setter Property="Background" Value="Transparent"/>
                <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
                <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
                <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="BorderBrush" Value="Transparent"/>
                <Setter Property="Padding" Value="0"/>
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="ListBox">
                                        <ScrollViewer x:Name="ScrollViewer" Foreground="{TemplateBinding Foreground}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                                                <ItemsPresenter/>
                                        </ScrollViewer>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>



        <!--x:Key="PhonePasswordBox"-->
        <Style TargetType="PasswordBox">
                <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
                <Setter Property="Background" Value="{StaticResource PhoneTextBoxBrush}"/>
                <Setter Property="Foreground" Value="{StaticResource PhoneTextBoxForegroundBrush}"/>
                <Setter Property="BorderBrush" Value="{StaticResource PhoneTextBoxBrush}"/>
                <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
                <Setter Property="SelectionBackground" Value="{StaticResource PhoneAccentBrush}"/>
                <Setter Property="SelectionForeground" Value="{StaticResource PhoneContrastBackgroundBrush}"/>
                <Setter Property="Padding" Value="2"/>
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="PasswordBox">
                                        <Grid Background="Transparent">
                                                <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup x:Name="CommonStates">
                                                                <VisualState x:Name="Normal"/>
                                                                <VisualState x:Name="MouseOver"/>
                                                                <VisualState x:Name="Disabled">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EnabledBorder" Storyboard.TargetProperty="Visibility">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                                                                <DiscreteObjectKeyFrame.Value>
                                                                                                        <Visibility>Collapsed</Visibility>
                                                                                                </DiscreteObjectKeyFrame.Value>
                                                                                        </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledBorder" Storyboard.TargetProperty="Visibility">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                                                                <DiscreteObjectKeyFrame.Value>
                                                                                                        <Visibility>Visible</Visibility>
                                                                                                </DiscreteObjectKeyFrame.Value>
                                                                                        </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                        </VisualStateGroup>
                                                        <VisualStateGroup x:Name="FocusStates">
                                                                <VisualState x:Name="Focused">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EnabledBorder" Storyboard.TargetProperty="Background">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxEditBackgroundBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="EnabledBorder" Storyboard.TargetProperty="BorderBrush">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxEditBorderBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="Unfocused"/>
                                                        </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Border x:Name="EnabledBorder" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Margin="{StaticResource PhoneTouchTargetOverhang}" >
                                                        <Border x:Name="ContentElement" BorderThickness="0" Padding="{TemplateBinding Padding}" Margin="{StaticResource PhonePasswordBoxInnerMargin}"/>
                                                </Border>
                                                <Border x:Name="DisabledBorder" Visibility="Collapsed" Background="Transparent" BorderBrush="{StaticResource PhoneDisabledBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="{StaticResource PhoneTouchTargetOverhang}" >
                                                        <PasswordBox x:Name="DisabledContent" Password="{TemplateBinding Password}" Foreground="{StaticResource PhoneDisabledBrush}" Background="Transparent"
              PasswordChar="{TemplateBinding PasswordChar}" Template="{StaticResource PhoneDisabledPasswordBoxTemplate}" />
                                                </Border>
                                        </Grid>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>


        <!--x:Key="PhoneTextBox"-->
        <Style TargetType="TextBox" >
                <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
                <Setter Property="Background" Value="{StaticResource PhoneTextBoxBrush}"/>
                <Setter Property="Foreground" Value="{StaticResource PhoneTextBoxForegroundBrush}"/>
                <Setter Property="BorderBrush" Value="{StaticResource PhoneTextBoxBrush}"/>
                <Setter Property="SelectionBackground" Value="{StaticResource PhoneAccentBrush}"/>
                <Setter Property="SelectionForeground" Value="{StaticResource PhoneTextBoxSelectionForegroundBrush}"/>
                <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
                <Setter Property="Padding" Value="2"/>
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="TextBox">
                                        <Grid Background="Transparent">
                                                <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup x:Name="CommonStates">
                                                                <VisualState x:Name="Normal"/>
                                                                <VisualState x:Name="MouseOver"/>
                                                                <VisualState x:Name="Disabled">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MainBorder" Storyboard.TargetProperty="Background">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MainBorder" Storyboard.TargetProperty="BorderBrush">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="ReadOnly">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MainBorder" Storyboard.TargetProperty="Visibility">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                                                                <DiscreteObjectKeyFrame.Value>
                                                                                                        <Visibility>Collapsed</Visibility>
                                                                                                </DiscreteObjectKeyFrame.Value>
                                                                                        </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ReadonlyBorder" Storyboard.TargetProperty="Visibility">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                                                                <DiscreteObjectKeyFrame.Value>
                                                                                                        <Visibility>Visible</Visibility>
                                                                                                </DiscreteObjectKeyFrame.Value>
                                                                                        </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ReadonlyBorder" Storyboard.TargetProperty="Background">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ReadonlyBorder" Storyboard.TargetProperty="BorderBrush">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxReadOnlyBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                        </VisualStateGroup>
                                                        <VisualStateGroup x:Name="FocusStates">
                                                                <VisualState x:Name="Focused">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MainBorder" Storyboard.TargetProperty="Background">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxEditBackgroundBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MainBorder" Storyboard.TargetProperty="BorderBrush">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxEditBorderBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="Unfocused"/>
                                                        </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Border x:Name="MainBorder" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Margin="{StaticResource PhoneTouchTargetOverhang}" />
                                                <Border x:Name="ReadonlyBorder" Visibility="Collapsed" Background="Transparent" BorderBrush="{StaticResource PhoneDisabledBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="{StaticResource PhoneTouchTargetOverhang}" />
                                                <Border Background="Transparent" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="Transparent" Margin="{StaticResource PhoneTouchTargetOverhang}">
                                                        <ContentControl x:Name="ContentElement" BorderThickness="0" Padding="{TemplateBinding Padding}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Margin="{StaticResource PhoneTextBoxInnerMargin}"/>
                                                </Border>
                                        </Grid>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>

        <!--x:Key="PhoneThumb"-->
        <Style TargetType="Thumb">
                <Setter Property="Background" Value="{StaticResource PhoneBackgroundColor}"/>
                <Setter Property="BorderBrush" Value="{StaticResource PhoneBackgroundColor}"/>
                <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
                <Setter Property="Height" Value="48"/>
                <Setter Property="Width" Value="48"/>
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="Thumb">
                                        <Border Background="Transparent">
                                                <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup x:Name="CommonStates">
                                                                <VisualState x:Name="Normal"/>
                                                                <VisualState x:Name="MouseOver"/>
                                                                <VisualState x:Name="Pressed">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="Background">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="BorderBrush">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="Disabled">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="Background">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="BorderBrush">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                        </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Border x:Name="Border" IsHitTestVisible="False" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Margin="{StaticResource PhoneTouchTargetOverhang}" />
                                        </Border>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>



        <!--x:Key="PhoneScrollbar"-->
        <Style TargetType="ScrollBar">
                <Setter Property="Background" Value="{StaticResource PhoneDisabledBrush}"/>
                <Setter Property="Padding" Value="1"/>
                <Setter Property="IsTabStop" Value="False"/>
                <Setter Property="MinWidth" Value="5"/>
                <Setter Property="MinHeight" Value="5"/>
                <Setter Property="IsHitTestVisible" Value="False"/>
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="ScrollBar">
                                        <Grid>
                                                <Grid x:Name="VerticalRoot" Background="Transparent" Width="{TemplateBinding Width}">
                                                        <Grid.RowDefinitions>
                                                                <RowDefinition Height="Auto"/>
                                                                <RowDefinition Height="Auto"/>
                                                                <RowDefinition Height="Auto"/>
                                                                <RowDefinition Height="*"/>
                                                                <RowDefinition Height="Auto"/>
                                                        </Grid.RowDefinitions>
                                                        <RepeatButton x:Name="VerticalSmallDecrease" Visibility="Collapsed" />
                                                        <RepeatButton x:Name="VerticalLargeDecrease" Template="{x:Null}" Width="0" Grid.Row="1"/>
                                                        <Thumb x:Name="VerticalThumb" Width="{TemplateBinding Width}" MinHeight="72" Background="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Template="{StaticResource PhoneScrollbarThumb}" Grid.Row="2"/>
                                                        <RepeatButton x:Name="VerticalLargeIncrease" Template="{x:Null}" Width="0" Grid.Row="3"/>
                                                        <RepeatButton x:Name="VerticalSmallIncrease" Visibility="Collapsed" />
                                                </Grid>
                                                <Grid x:Name="HorizontalRoot" Background="Transparent" Height="{TemplateBinding Height}">
                                                        <Grid.ColumnDefinitions>
                                                                <ColumnDefinition Width="Auto"/>
                                                                <ColumnDefinition Width="Auto"/>
                                                                <ColumnDefinition Width="Auto"/>
                                                                <ColumnDefinition Width="*"/>
                                                                <ColumnDefinition Width="Auto"/>
                                                        </Grid.ColumnDefinitions>
                                                        <RepeatButton x:Name="HorizontalSmallDecrease" Visibility="Collapsed" />
                                                        <RepeatButton x:Name="HorizontalLargeDecrease" Template="{x:Null}" Height="0" Grid.Column="1"/>
                                                        <Thumb x:Name="HorizontalThumb" Height="{TemplateBinding Height}" MinWidth="72" Background="{TemplateBinding Background}" Margin="{TemplateBinding Padding}" Template="{StaticResource PhoneScrollbarThumb}" Grid.Column="2"/>
                                                        <RepeatButton x:Name="HorizontalLargeIncrease" Template="{x:Null}" Height="0" Grid.Column="3"/>
                                                        <RepeatButton x:Name="HorizontalSmallIncrease" Visibility="Collapsed"/>
                                                </Grid>
                                        </Grid>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>

        <!--x:Key="PhoneHyperlinkButton"-->
        <Style TargetType="HyperlinkButton">
                <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
                <Setter Property="Background" Value="Transparent"/>
                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMedium}"/>
                <Setter Property="Padding" Value="0"/>
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="HyperlinkButton">
                                        <Border Background="Transparent">
                                                <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup x:Name="CommonStates">
                                                                <VisualState x:Name="Normal"/>
                                                                <VisualState x:Name="MouseOver"/>
                                                                <VisualState x:Name="Pressed">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextElement" Storyboard.TargetProperty="Foreground">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneAccentBrush}"/>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                                <VisualState x:Name="Disabled">
                                                                        <Storyboard>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextElement" Storyboard.TargetProperty="Foreground">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                        </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Border Background="{TemplateBinding Background}" Margin="{StaticResource PhoneHorizontalMargin}" Padding="{TemplateBinding Padding}" >
                                                        <TextBlock x:Name="TextElement" Text="{TemplateBinding Content}" TextDecorations="Underline" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                                </Border>
                                        </Border>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>


        <!--x:Key="PhoneProgressBar"-->
        <Style TargetType="ProgressBar">
                <Setter Property="Foreground" Value="{StaticResource PhoneAccentBrush}"/>
                <Setter Property="Background" Value="{StaticResource PhoneProgressBarBackgroundBrush}"/>
                <Setter Property="Maximum" Value="100"/>
                <Setter Property="IsHitTestVisible" Value="False"/>
                <Setter Property="Padding" Value="{StaticResource PhoneHorizontalMargin}"/>
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="ProgressBar">
                                        <Grid>
                                                <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup x:Name="CommonStates">
                                                                <VisualState x:Name="Determinate"/>
                                                                <VisualState x:Name="Indeterminate">
                                                                        <Storyboard RepeatBehavior="Forever" Duration="00:00:00">
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="IndeterminateRoot" Storyboard.TargetProperty="Visibility">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                                                                <DiscreteObjectKeyFrame.Value>
                                                                                                        <Visibility>Visible</Visibility>
                                                                                                </DiscreteObjectKeyFrame.Value>
                                                                                        </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DeterminateRoot" Storyboard.TargetProperty="Visibility">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                                                                <DiscreteObjectKeyFrame.Value>
                                                                                                        <Visibility>Collapsed</Visibility>
                                                                                                </DiscreteObjectKeyFrame.Value>
                                                                                        </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                        </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Grid x:Name="DeterminateRoot" Visibility="Visible" Margin="{TemplateBinding Padding}">
                                                        <Rectangle x:Name="ProgressBarTrack" Fill="{TemplateBinding Background}" Height="4" />
                                                        <Rectangle x:Name="ProgressBarIndicator" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Left" Height="4" />
                                                </Grid>
                                                <Border x:Name="IndeterminateRoot" Visibility="Collapsed" Margin="{TemplateBinding Padding}">
                                                        <Grid x:Name="SliderContainer" IsHitTestVisible="False">
                                                                <Rectangle x:Name="Slider0" Width="4" Height="4" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Left" CacheMode="BitmapCache" />
                                                                <Rectangle x:Name="Slider1" Width="4" Height="4" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Left" CacheMode="BitmapCache" />
                                                                <Rectangle x:Name="Slider2" Width="4" Height="4" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Left" CacheMode="BitmapCache" />
                                                                <Rectangle x:Name="Slider3" Width="4" Height="4" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Left" CacheMode="BitmapCache" />
                                                                <Rectangle x:Name="Slider4" Width="4" Height="4" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Left" CacheMode="BitmapCache" />
                                                        </Grid>
                                                </Border>
                                        </Grid>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>

        <!--x:Key="PhoneSlider"-->
        <Style TargetType="Slider">
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="BorderBrush" Value="Transparent"/>
                <Setter Property="Maximum" Value="10"/>
                <Setter Property="Minimum" Value="0"/>
                <Setter Property="Value" Value="0"/>
                <Setter Property="Background" Value="{StaticResource PhoneChromeBrush}"/>
                <Setter Property="Foreground" Value="{StaticResource PhoneAccentBrush}"/>
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="Slider">
                                        <Grid Background="Transparent">
                                                <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup x:Name="CommonStates">
                                                                <VisualState x:Name="Normal"/>
                                                                <VisualState x:Name="MouseOver"/>
                                                                <VisualState x:Name="Disabled">
                                                                        <Storyboard>
                                                                                <DoubleAnimation Duration="0" Storyboard.TargetName="HorizontalTrack" Storyboard.TargetProperty="Opacity" To="0.1" />
                                                                                <DoubleAnimation Duration="0" Storyboard.TargetName="VerticalTrack" Storyboard.TargetProperty="Opacity" To="0.1" />
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalFill" Storyboard.TargetProperty="Fill">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalFill" Storyboard.TargetProperty="Fill">
                                                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                        </Storyboard>
                                                                </VisualState>
                                                        </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Grid x:Name="HorizontalTemplate" Margin="{StaticResource PhoneHorizontalMargin}">
                                                        <Rectangle x:Name="HorizontalTrack" Fill="{TemplateBinding Background}" Height="12" IsHitTestVisible="False" Margin="0,22,0,50"/>
                                                        <Rectangle x:Name="HorizontalFill" Fill="{TemplateBinding Foreground}" Height="12" IsHitTestVisible="False" Margin="0,22,0,50">
                                                                <Rectangle.Clip>
                                                                        <RectangleGeometry Rect="0, 0, 6, 12" />
                                                                </Rectangle.Clip>
                                                        </Rectangle>
                                                        <Rectangle x:Name="HorizontalCenterElement" HorizontalAlignment="Left" Fill="{StaticResource PhoneForegroundBrush}" Width="12" Height="24" Margin="0,16,0,44">
                                                                <Rectangle.RenderTransform>
                                                                        <TranslateTransform />
                                                                </Rectangle.RenderTransform>
                                                        </Rectangle>
                                                </Grid>
                                                <Grid x:Name="VerticalTemplate" Margin="{StaticResource PhoneVerticalMargin}">
                                                        <Rectangle x:Name="VerticalTrack" Fill="{TemplateBinding Background}" Width="12" IsHitTestVisible="False" Margin="18,0,18,0"/>
                                                        <Rectangle x:Name="VerticalFill" Fill="{TemplateBinding Foreground}" Width="12" IsHitTestVisible="False" Margin="18,0,18,0">
                                                                <Rectangle.Clip>
                                                                        <RectangleGeometry Rect="0, 0, 12, 6" />
                                                                </Rectangle.Clip>
                                                        </Rectangle>
                                                        <Rectangle x:Name="VerticalCenterElement" VerticalAlignment="Top" Fill="{StaticResource PhoneForegroundBrush}" Width="24" Height="12" Margin="12,0,12,0">
                                                                <Rectangle.RenderTransform>
                                                                        <TranslateTransform />
                                                                </Rectangle.RenderTransform>
                                                        </Rectangle>
                                                </Grid>
                                        </Grid>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>

        <!--x:Key="PhoneRichTextBox"-->
        <Style TargetType="RichTextBox">
                <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeNormal}" />
                <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}" />
                <Setter Property="Background" Value="Transparent" />
                <Setter Property="BorderBrush" Value="Transparent" />
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                <Setter Property="VerticalContentAlignment" Value="Center" />
                <Setter Property="Padding" Value="0" />
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="RichTextBox">
                                        <Grid Background="Transparent">
                                                <Border Background="{TemplateBinding Background}" 
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        Margin="{StaticResource PhoneHorizontalMargin}">
                                                        <ContentControl x:Name="ContentElement"
                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                            Padding="{TemplateBinding Padding}"/>
                                                </Border>
                                        </Grid>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>

        <!--x:Key="PhoneSlider"-->
        <Style TargetType="ViewportControl">
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="ViewportControl">
                                        <ContentPresenter
                    x:Name="ContentElement"
                    Content="{TemplateBinding Content}"
                    ContentTemplate="{TemplateBinding ContentTemplate}"
                    Cursor="{TemplateBinding Cursor}"
                    Margin="{TemplateBinding Padding}"
                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>

        <Style TargetType="toolkit:ContextMenu">
                <Setter Property="Background" Value="White"/>
        </Style>

        <Style TargetType="toolkit:MenuItem">
                <Setter Property="Foreground" Value="Black"/>
        </Style>

</ResourceDictionary>

  